import { Button, Modal } from 'antd';
import React, { useState } from 'react';

interface Props {
  isShowModal: boolean,
  setIsShowModal: (flag:boolean) => void,
  children?: React.ReactNode, 
  title?: string
}

export default ({ isShowModal, setIsShowModal, children = <></>, title = '修改密码' }: Props) => {

  const handleOk = () => {
    setIsShowModal(false);
  };

  const handleCancel = () => {
    setIsShowModal(false);
  };

  return (
    <>
      <Modal 
        title={title} 
        open={isShowModal} 
        onOk={handleOk} 
        onCancel={handleCancel}
        footer={[]}
        >
          <div style={{ width: "80%" }}>
            {children}
          </div>
      </Modal>
    </>
  );
};
